<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Subject-Observer: Automobile Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Subject-Observer
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_automobile.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="class_automobile-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Automobile Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Represents an <a class="el" href="class_automobile.html" title="Represents an Automobile.">Automobile</a>.  
 <a href="class_automobile.html#details">More...</a></p>

<p><code>#include &lt;Automobile.h&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Automobile:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_automobile.png" usemap="#Automobile_map" alt=""/>
  <map id="Automobile_map" name="Automobile_map">
<area href="class_object.html" title="Common Baseclass for all other classes." alt="Object" shape="rect" coords="0,0,74,24"/>
<area href="class_p_k_w.html" title="Represents a PKW which is a specialisation of an Automobile." alt="PKW" shape="rect" coords="0,112,74,136"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a43b310835f4c5f0ab84a3bc1110e8bda"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_automobile.html#a43b310835f4c5f0ab84a3bc1110e8bda">Attach</a> (<a class="el" href="class_i_display.html">IDisplay</a> *obs)</td></tr>
<tr class="memdesc:a43b310835f4c5f0ab84a3bc1110e8bda"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a Display (Observer) to the list of observers.  <a href="#a43b310835f4c5f0ab84a3bc1110e8bda"></a><br/></td></tr>
<tr class="separator:a43b310835f4c5f0ab84a3bc1110e8bda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4411b280ecc878442faf43c0cf080b0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_automobile.html#ab4411b280ecc878442faf43c0cf080b0">Detach</a> (<a class="el" href="class_i_display.html">IDisplay</a> *obs)</td></tr>
<tr class="memdesc:ab4411b280ecc878442faf43c0cf080b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes obs from the list of observers.  <a href="#ab4411b280ecc878442faf43c0cf080b0"></a><br/></td></tr>
<tr class="separator:ab4411b280ecc878442faf43c0cf080b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_object"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_object')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_object.html">Object</a></td></tr>
<tr class="memitem:aa3e791419d84c4c346ef9499513b8e00 inherit pub_methods_class_object"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_object.html#aa3e791419d84c4c346ef9499513b8e00">~Object</a> ()</td></tr>
<tr class="memdesc:aa3e791419d84c4c346ef9499513b8e00 inherit pub_methods_class_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">DTor of the <a class="el" href="class_object.html" title="Common Baseclass for all other classes.">Object</a> class.  <a href="#aa3e791419d84c4c346ef9499513b8e00"></a><br/></td></tr>
<tr class="separator:aa3e791419d84c4c346ef9499513b8e00 inherit pub_methods_class_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr class="memitem:abf006ff8710f4f6e857f432eb151e325"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abf006ff8710f4f6e857f432eb151e325"></a>
typedef std::list&lt; <a class="el" href="class_i_display.html">IDisplay</a> * &gt;<br class="typebreak"/>
::const_iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_automobile.html#abf006ff8710f4f6e857f432eb151e325">TObserversConstIterator</a></td></tr>
<tr class="memdesc:abf006ff8710f4f6e857f432eb151e325"><td class="mdescLeft">&#160;</td><td class="mdescRight">A constant Iterator for the observers list. <br/></td></tr>
<tr class="separator:abf006ff8710f4f6e857f432eb151e325"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2019c87470f292f3b7b25e0af2b22477"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2019c87470f292f3b7b25e0af2b22477"></a>
typedef std::list&lt; <a class="el" href="class_i_display.html">IDisplay</a> * &gt;<br class="typebreak"/>
::iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_automobile.html#a2019c87470f292f3b7b25e0af2b22477">TObserversIterator</a></td></tr>
<tr class="memdesc:a2019c87470f292f3b7b25e0af2b22477"><td class="mdescLeft">&#160;</td><td class="mdescRight">An Iterator for the observers list. <br/></td></tr>
<tr class="separator:a2019c87470f292f3b7b25e0af2b22477"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ae54e63094fff2815c982517b498cd54c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_automobile.html#ae54e63094fff2815c982517b498cd54c">Notify</a> () const </td></tr>
<tr class="memdesc:ae54e63094fff2815c982517b498cd54c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates all observers.  <a href="#ae54e63094fff2815c982517b498cd54c"></a><br/></td></tr>
<tr class="separator:ae54e63094fff2815c982517b498cd54c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_static_methods_class_object"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_class_object')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="class_object.html">Object</a></td></tr>
<tr class="memitem:a86a84ed2d1207e5f8827165ac2941106 inherit pub_static_methods_class_object"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_object.html#a86a84ed2d1207e5f8827165ac2941106">deleteObject</a> (<a class="el" href="class_object.html">Object</a> *obj)</td></tr>
<tr class="memdesc:a86a84ed2d1207e5f8827165ac2941106 inherit pub_static_methods_class_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the memory used by obj.  <a href="#a86a84ed2d1207e5f8827165ac2941106"></a><br/></td></tr>
<tr class="separator:a86a84ed2d1207e5f8827165ac2941106 inherit pub_static_methods_class_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents an <a class="el" href="class_automobile.html" title="Represents an Automobile.">Automobile</a>. </p>
<p>The class <a class="el" href="class_automobile.html" title="Represents an Automobile.">Automobile</a> represents an automobile. Acts as Base class for vehicles and implements the Subject functionality (Attach, detach, notify) and also manages a list of Observers (Display). In terms of design patterns (Subject Observer) it's a Subject.</p>
<dl class="section author"><dt>Author</dt><dd>Thomas Pfeiffer </dd></dl>
<dl class="section date"><dt>Date</dt><dd>13.11.2012 </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a43b310835f4c5f0ab84a3bc1110e8bda"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Automobile::Attach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_i_display.html">IDisplay</a> *&#160;</td>
          <td class="paramname"><em>obs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds a Display (Observer) to the list of observers. </p>
<p>The function Attach adds the Display (Observer) obs to the list of observers. obs's Update function will be called when Notify is called. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">obs</td><td>A Pointer to a Display which should be updated in case of a notify. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab4411b280ecc878442faf43c0cf080b0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Automobile::Detach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_i_display.html">IDisplay</a> *&#160;</td>
          <td class="paramname"><em>obs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes obs from the list of observers. </p>
<p>The function Detach removes the Display obs from the list of observers. obs will not be updated in case of a notify any more. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">obs</td><td>A Pointer to a Display which should be removed from the list of the observers. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae54e63094fff2815c982517b498cd54c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Automobile::Notify </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Updates all observers. </p>
<p>The function notify is called if the Data of the concrete subject changed. Calls update on all observers in the list. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_automobile.html">Automobile</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
